package edu.fiu.ann;


import edu.fiu.ann.initializer.GaussianInitializer;
import edu.fiu.ann.initializer.Initializer;
import edu.fiu.ann.utility.Pair;

public abstract class NeuralNetwork {
	//	weight initialization method
	final static public String GUASSIAN = "Gaussian";
	final static public String UNIFORM = "Uniform";
	protected Initializer initializer;
	
	/**
	 * Construct neural network with default weight initializer.
	 */
	public NeuralNetwork(){
		initializer = new GaussianInitializer();
	}
	
	/**
	 * Construct neural network with explicit weight initializer.
	 * @param initialzier
	 */
	public NeuralNetwork(Initializer initialzier){
		this.initializer = initialzier;
	}
	
	/**
	 * Train the neural network using trainging data.
	 * @param trainingData	the training data.
	 */
	abstract public void train(double[][] trainingData);
	
	/**
	 * Use neural network to get the output according to input.
	 * @param input	the input instance.
	 * @return	the output.
	 */
	abstract public double[] output(double[] input);
	
	/**
	 * Get the intermediate variables for training.
	 * @param trainingInstance
	 * @return
	 */
	abstract protected Pair<double[], double[]> trainUpdateInfo(double[] trainingInstance);
	
}
